package com.fs.wechat.config;

import com.fs.wechat.constants.WXConstants;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.service.impl.WxPayServiceJoddHttpImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author DeveloperKK
 * @desc
 * @creationTime 2019-08-21 10:38
 * @projectName yuezi-menu
 * @packageName com.fs.console.base.config
 */
@Configuration
public class WechatConfig {

    @Bean
    public WxPayService wxPayService(){
        WxPayServiceJoddHttpImpl serviceJoddHttp =  new WxPayServiceJoddHttpImpl();
        WxPayConfig config = new WxPayConfig();
        config.setSignType("MD5");
        config.setAppId(WXConstants.APP_ID);
        serviceJoddHttp.setConfig(config);
        return serviceJoddHttp;
    }
}
